<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算属性</title>
    <script src="https://unpkg.com/vue@next"></script>
  </head>
  <body>
    <div style="text-align: center;" id="Application">
        <div>{{typeFunc()}}</div>
        <button @click="add">Add</button>
    </div>
  </body>

  <script>
    const App= {
      data(){
        return {
          count:0
        }
      },
      computed:{
        type(){
            return this.count > 10 ? "大" : "小"
        }
      },
      methods: {
        add(){
          this.count ++
        },
        typeFunc(){
            return this.count > 10 ? "大" : "小"
        }
      }
    }
    var instance = Vue.createApp(App).mount("#Application")
    console.log("Variable [instance.type] =>",instance.type);
  </script>
</html>